// import { Dialog, Message } from '@shared/components';
import { Button, Space } from '@douyinfe/semi-ui';
import Dialog from '@shared/components/Dialog';
import { useStore } from '@shared/store';
import { IAdminStore } from '@shared/types';
import { AdminDialog } from '@admin/components/AdminDialog';
import React, { useEffect, useState } from 'react';
import Message from '@shared/components/Message';

export type DashboardProps = {
    //props
}

const Dashboard: React.FC<DashboardProps> = (props: DashboardProps): JSX.Element => {
    const store = useStore<IAdminStore>();
    const [ showDialog, setShowDialog ] = useState<boolean>(false);

    return <div>
        <h1>Dashboard</h1>
        <AdminDialog 
            visible={showDialog}
            title="SSSs"
            onOk={() => setShowDialog(false)}
            onCancel={() => setShowDialog(false)}
        >
            <h1>XXXXXX</h1>
        </AdminDialog>

        <Space>
        <Button type="primary" onClick={() => {
            Dialog.alert({
                content: '测试大厦收到货!',
            });
        }}>测试弹窗 1</Button>

        <Button type="primary" onClick={() => {
            setShowDialog(true);
        }}>测试弹窗 2</Button>

        <Button type="primary" onClick={() => {
            Message.success('Test!');
        }}>测试消息提示 success</Button>

        <Button type="primary" onClick={() => {
            Message.error('Ops! ');
        }}>测试消息提示 error</Button>
        </Space>
    </div>;
};

export default Dashboard;
